home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 1 April 1997
- //
- // Description:
- // This implements the "Polygons" menu on the modeling menubar.
- //
-
- global proc string polygonsMenuItemToShelf (string $item)
- {
- return $item;
- }
-
-
-
- proc PolyToolOptionsMenu(string $parent)
- //
- // Description:
- // Polygon tool options menu
- //
- {
- setParent -m $parent;
-
- menuItem -l "Keep New Faces Planar" -ecr false -cb false
- -ann "Keep New Faces Planar: Check to maintain newly created faces planar"
- -dmc "polygonsMenuItemToShelf \"togglePolyPlanarConstraints\""
- -c "togglePolyPlanarConstraints" togglePlanarItem;
-
- menuItem -l "Keep Faces Together" -ecr false -cb false
- -dmc "polygonsMenuItemToShelf \"togglePolyMoveComponents\""
- -ann "Keep Faces Together: Check for Extrude/Extract/Duplicate to move the faces as a whole instead of separately"
- -c "togglePolyMoveComponents" toggleGroupItem;
-
- menuItem -divider true;
-
- menuItem -l "Convert Selection" -ecr false -cb false
- -ann "Convert Selection: Automatic conversion of selected object into its appropriate components"
- -dmc "polygonsMenuItemToShelf \"togglePolyAutoConvertAction\""
- -c "togglePolyAutoConvertAction" toggleAutoConvertItem;
-
- menuItem -l "Smart Command Settings" -ecr false -cb false
- -ann "Smart Command Settings: If selection is inadequate for required command, install selection constraints and display attributes"
- -dmc "polygonsMenuItemToShelf \"togglePolyAutoInstallAction\""
- -c "togglePolyAutoInstallAction" toggleAutoInstallItem;
-
- menuItem -l "Reset to Default Settings" -ecr false
- -ann "Reset to Default Settings: Remove selection constraints and display attributes that may have been set for previous command"
- -dmc "polygonsMenuItemToShelf \"polyInstallAction\""
- -c "polyInstallAction";
- }
-
-
- //////////////////////////////////////////////////////////////////////
-
- global proc PolygonsMenu(string $parent)
- //
- // Description:
- // Polygon creation menu
- //
- {
- if (! `isTrue "PolygonsExists"`) return;
-
- setParent -m $parent;
-
- if (`menu -q -ni $parent` == 0) {
-
-
- menuItem -l "Create Polygon Tool" -i "polyCreateFacet.xpm"
- -ann "Create Polygon Tool: Create polygon faces"
- -ddc "setToolTo polyCreateFacetContext ; polyCreateFacetCtx -e -pc `optionVar -q polyKeepFacetsPlanar` polyCreateFacetContext; toolPropertyWindow"
- -dmc "polygonsMenuItemToShelf \"setToolTo polyCreateFacetContext ; polyCreateFacetCtx -e -pc `optionVar -q polyKeepFacetsPlanar` polyCreateFacetContext\""
- -c "CreatePolygonTool" createItem;
- menuItem -optionBox 1 -i "polyCreateFacet.xpm"
- -annotation "Create Polygon Tool Option Box"
- -l "Create Polygon Tool Option Box" -c "CreatePolygonToolOptions"
- createOptionItem;
-
- menuItem -l "Append to Polygon Tool" -i "polyAppendFacet.xpm"
- -ann "Append to Polygon Tool: Append a face to the selected shell. Select border edges to append a face to"
- -ddc "setToolTo polyAppendFacetContext ; polyAppendFacetCtx -e -pc `optionVar -q polyKeepFacetsPlanar` polyAppendFacetContext; toolPropertyWindow"
- -dmc "polygonsMenuItemToShelf \"setToolTo polyAppendFacetContext ; polyAppendFacetCtx -e -pc `optionVar -q polyKeepFacetsPlanar` polyAppendFacetContext\""
- -c "AppendToPolygonTool" appendItem;
- menuItem -optionBox 1 -i "polyAppendFacet.xpm"
- -annotation "Append to Polygon Tool Option Box"
- -l "Append to Polygon Tool Option Box"
- -ecr false
- -c "AppendToPolygonToolOptions" appendOptionItem;
-
- //////////////////////////////////////////////////////////////////////
- menuItem -divider true;
-
- menuItem -l "Combine" -ecr true
- -i "polyUnite.xpm"
- -ann "Combine: Combine the selected polygon objects into one single object to allow operations such as merges or face trims"
- -dmc "polygonsMenuItemToShelf \"polyPerformAction polyUnite o 0\""
- -c "CombinePolygons";
-
- menuItem -l "Transfer"
- -ann "Transfer: Select two objects to be crossed"
- -c "performPolyTransfer 0" -i "polyTransfer.xpm" ;
-
- menuItem -optionBox 1
- -l "Transfer Option Box" -ann "Transfer Option Box"
- -c "performPolyTransfer 1" -ecr false -i "polyTransfer.xpm" ;
-
- menuItem -l "Booleans" -sm 1 -to 1;
- menuItem -l "Union" -ecr true
- -i "polyBooleansUnion.xpm"
- -ann "Union: Performs a boolean Union on the selected polygon objects, creating a new object"
- -dmc "polygonsMenuItemToShelf \"polyPerformAction \\\"polyBoolOp -op 1\\\" o 0\""
- -c "PolygonBooleanUnion";
- menuItem -l "Difference" -ecr true
- -i "polyBooleansDifference.xpm"
- -ann "Difference: Performs a boolean Difference on the selected polygon objects, creating a new object"
- -dmc "polygonsMenuItemToShelf \"polyPerformAction \\\"polyBoolOp -op 2\\\" o 0\""
- -c "PolygonBooleanDifference";
- menuItem -l "Intersection" -ecr true
- -i "polyBooleansIntersection.xpm"
- -ann "Intersection: Performs a boolean Intersection on the selected polygon objects, creating a new object"
- -dmc "polygonsMenuItemToShelf \"polyPerformAction \\\"polyBoolOp -op 3\\\" o 0\""
- -c "PolygonBooleanIntersection";
- setParent -m ..;
-
- // m2.1 Mirror
- menuItem -l "Mirror Geometry" -i "polyMirrorGeometry.xpm"
- -ecr true
- -dmc "performPolyMirror 2"
- -ddc "performPolyMirror 1"
- -c "MirrorPolygonGeometry"
- -ann "Mirror: Mirror geometry across an axis."
- mirrorItem;
- menuItem -optionBox 1
- -ecr false
- -i "polyMirrorGeometry.xpm"
- -ann "Mirror Geometry Option Box"
- -l "Mirror Geometry Option Box"
- -c "MirrorPolygonGeometryOptions"
- mirrorOptionItem;
-
- //////////////////////////////////////////////////////////////////////
- menuItem -divider true;
-
- menuItem -l "Smooth" -ecr true
- -i "polySmooth.xpm"
- -ann "Smooth: Add polygons to the selected polygon objects to smooth them"
- -ddc "performPolySmooth 1"
- -dmc "performPolySmooth 2" -c "SmoothPolygon";
- menuItem -optionBox 1 -i "polySmooth.xpm"
- -annotation "Smooth Option Box"
- -l "Smooth Option Box" -ecr false -c "SmoothPolygonOptions";
-
- menuItem -l "Smooth Proxy" -ecr true
- -i "polySmoothProxy.xpm"
- -ann "Smooth: Add polygons to the selected polygon objects to smooth them"
- -ddc "performSmoothProxy 1"
- -dmc "performSmoothProxy 2" -c "SmoothProxy";
- menuItem -optionBox 1 -i "polySmoothProxy.xpm"
- -annotation "Smooth Option Box"
- -l "Smooth Option Box" -ecr false -c "SmoothProxyOptions";
-
- menuItem -l "Average Vertices"
- -ann "Average Vertices: Move selected vertices to smooth shape"
- -c "performPolyAverageVertex 0" -i "polyAverageVertex.xpm";
- menuItem -optionBox 1
- -l "Average Vertices Option Box" -ann "Average Vertices Option Box"
- -c "performPolyAverageVertex 1" -ecr false -i "polyAverageVertex.xpm";
-
- menuItem -l "Triangulate" -ecr true -i "polyTriangulate.xpm"
- -dmc "polygonsMenuItemToShelf \"polyPerformAction polyTriangulate f 0\""
- -c "Triangulate"
- -ann "Triangulate: Change the selected faces into triangles"
- triangulateItem;
-
- menuItem -l "Quadrangulate" -ecr true -i "polyQuad.xpm"
- -ddc "performPolyQuadrangulate 1"
- -dmc "performPolyQuadrangulate 2"
- -ann "Quadrangulate: Change the selected faces into quadrilaterals"
- -c "Quadrangulate" quadrangulateItem;
- menuItem -optionBox 1 -i "polyQuad.xpm"
- -annotation "Quadrangulate Option Box"
- -l "Quadrangulate Option Box" -ecr false -c "QuadrangulateOptions"
- quadrangulateOptionItem;
-
- // m2.1 Cleanup
- menuItem -l "Cleanup" -ecr true -i "polyCleanup.xpm"
- -dmc "performPolyCleanup 2"
- -ddc "performPolyCleanup 1"
- -c "CleanupPolygon"
- -ann "Cleanup : Select, or select and remove, different types of polygonal geometry"
- cleanupItem;
- menuItem -optionBox 1
- -i "polyCleanup.xpm"
- -ann "Cleanup Option Box"
- -l "Cleanup Option Box" -ecr false -c "CleanupPolygonOptions"
- cleanupOptionItem;
-
- menuItem -divider true;
-
- // m2.1 Reduction
- menuItem -l "Reduce" -ecr true -i "polyReduce.xpm"
- -dmc "performPolyReduce 2"
- -ddc "performPolyReduce 1"
- -c "ReducePolygon"
- -ann "Reduce : Reduce number of polygonal components for selected objects"
- reductionItem;
- menuItem -optionBox 1
- -i "polyReduce.xpm"
- -ann "Poly Reduce Option Box"
- -l "Poly Reduce Option Box" -ecr false
- -c "ReducePolygonOptions"
- reductionOptionItem;
-
- menuItem
- -label "Paint Reduce Weights Tool"
- -annotation (getRunTimeCommandAnnotation("PaintReduceWeightsTool"))
- -image "polyReduce.xpm"
- -command "PaintReduceWeightsTool"
- -dragDoubleClickCommand "PaintReduceWeightsToolOptions"
- ;
-
- menuItem -optionBox true
- -annotation (getRunTimeCommandAnnotation("PaintReduceWeightsToolOptions"))
- -image "polyReduce.xpm"
- -command "PaintReduceWeightsToolOptions"
- ;
-
- menuItem -divider true;
-
- // Options
- string $optItem=`menuItem -l "Tool Options" -sm 1 -to 1 -aob true polyOptionsItem`;
- PolyToolOptionsMenu $optItem;
- setParent -m ..;
-
-
- menuItem -e -cb `optionVar -q polyKeepFacetsPlanar` togglePlanarItem;
- menuItem -e -cb `optionVar -q polyKeepFacetsGrouped` toggleGroupItem;
- menuItem -e -cb `optionVar -q polyAutoInstallAction` toggleAutoInstallItem;
- menuItem -e -cb `optionVar -q polyAutoConvertAction` toggleAutoConvertItem;
- }
- }
-